<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ page import="net.sureon.dao.*"%>
<%@ page import="net.sureon.common.DateFormat" %>
<%@page import="java.text.SimpleDateFormat"%>
<%
	List<DailyTiming> all = null;
	all = (List<DailyTiming>) request.getAttribute("all");
%>
<%
int currentPage = (Integer)request.getAttribute("currentPage");
int pageCounter = (Integer)request.getAttribute("pageCounter");
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
	<head>
		<title>我的考勤</title>
	</head>
	<body>
		<jsp:include page="../header.jsp"></jsp:include>
			<div>
				<table cellpadding="0" cellspacing="0" class="style1">
					<tr>
						<td colspan="1">

							<table cellpadding="0" cellspacing="0" class="style5">

								<tr>
									<td colspan="5" style="text-align: left">
								<TR>
									<TD class=style6 style="TEXT-ALIGN: left" bgColor=#fffbd6>
										<TABLE class=ctl00_ContentPlaceHolder1_Menu1_2
											id=ctl00_ContentPlaceHolder1_Menu1 cellSpacing=0
											cellPadding=0 border=0>
											<TBODY>
												<TR>
													<TD id=ctl00_ContentPlaceHolder1_Menu1n1
														onkeyup=Menu_Key(this) onmouseover=Menu_HoverStatic(this)
														onmouseout=Menu_Unhover(this)>
														<TABLE class=ctl00_ContentPlaceHolder1_Menu1_4
															cellSpacing=0 cellPadding=0 width="100%" border=0>
															<TBODY>
																<TR>
																	<TD style="WHITE-SPACE: nowrap">
																		<A
																			class="ctl00_ContentPlaceHolder1_Menu1_1 ctl00_ContentPlaceHolder1_Menu1_3"
																			href="<%=request.getContextPath() %>/user/myDailyTiming.do">可编辑的考勤</A>
																	</TD>
																</TR>
															</TBODY>
														</TABLE>
													</TD>
													<TD style="WIDTH: 3px"></TD>
													
													
													<TD id=ctl00_ContentPlaceHolder1_Menu1n0
														onkeyup=Menu_Key(this) onmouseover=Menu_HoverStatic(this)
														onmouseout=Menu_Unhover(this)>
														<TABLE
															class="ctl00_ContentPlaceHolder1_Menu1_4 ctl00_ContentPlaceHolder1_Menu1_9"
															cellSpacing=0 cellPadding=0 width="100%" border=0>
															<TBODY>
																<TR>
																	<TD style="WHITE-SPACE: nowrap">
																		<A
																			class="ctl00_ContentPlaceHolder1_Menu1_1 ctl00_ContentPlaceHolder1_Menu1_3 ctl00_ContentPlaceHolder1_Menu1_8"
																			href="<%=request.getContextPath() %>/user/myConfirmApply.do">已批准的考勤</A>
																	</TD>
																</TR>
															</TBODY>
														</TABLE>
													</TD>
													
													
												</TR>
											</TBODY>
										</TABLE>
									</TD>
								</TR>

								<table cellpadding="0" cellspacing="0" class="style5">
									<tr>
										<td style="text-align: left">
											<div>
												<table cellspacing="0" cellpadding="4" border="0"
													id="ctl00_ContentPlaceHolder1_GridView1"
													style="color: #333333; font-family: Arial; font-size: Small; width: 100%; border-collapse: collapse;">
													<tr align="center"
														style="color: White; background-color: #507CD1; font-weight: bold;">
														<th scope="col" style="color: White;">日期</th>
														<th scope="col" style="color: White;">星期</th>
														<th scope="col" style="color: White;">工作时间</th>
														<th scope="col" style="color: White;">加班时间</th>
														<th scope="col" style="color: White;">休假时间</th>
														<th scope="col" style="color: White;">请假时间</th>
														<th scope="col" style="color: White;">审核意见/备注</th>
														<th scope="col" style="color: White;">批准日期</th>
														<th scope="col" style="color: White;">批准</th>
													</tr>



												<%
													if (all == null || all.size() == 0) {
												%>
												<%
													
													} else {
														String bgColor=null;
														String color_a = "#FFFFFF";
														String color_b = "#EFF3FB";
														for (int i = 0; i < all.size(); i++) {
															bgColor = (i%2 == 0)?color_a:color_b;
															DailyTiming dt = all.get(i);
															Date date = dt.getSubmitDate();
															java.text.SimpleDateFormat sdf = new java.text.SimpleDateFormat(
																	"E");
															java.text.DecimalFormat df = new java.text.DecimalFormat("####");
													%>


													<tr align="center" style="background-color: <%=bgColor%>;">
														<td style="width: 75px;">
															<a href="<%=request.getContextPath() + "/user/myConfirmApply.do?showContent=true&dailyTimingID=" + dt.getDailyTimingID() %>"><%=DateFormat.formatToSimple(dt.getWorkDate()) %></a>
														</td>
														<td style="width: 75px;">
															<%=sdf.format(dt.getWorkDate())%>
														</td>
														<td style="width: 60px;">
															<%=df.format(dt.getWorkTime())%>
														</td>
														<td style="width: 60px;">
															<%=df.format(dt.getOverTime())%>
														</td>
														<td style="width: 60px;">
															<%=df.format(dt.getVocationTime())%>
														</td>
														<td style="width: 60px;">
															<%=df.format(dt.getLeaveTime())%>
														</td>
														<td>
															<%=dt.getReviewNote()%>
														</td>
														<td style="width: 75px;">
															<%=DateFormat.formatToDetail(dt.getReviewDate()) %>
														</td>
														<td style="width: 75px;">
															<%=dt.getReviewer().getRealName() == null ? "无" : dt.getReviewer().getRealName() %>
														</td>
													</tr>


													<%
															}	
														}
													%>


												</table>
											</div>

										</td>
									</tr>
									
								<TR>
									<TD style="TEXT-ALIGN: center">
										<jsp:include page="../splitPage.jsp">
										<jsp:param name="url" value="/user/myConfirmApply.do"/>
										<jsp:param name="currentPage" value="<%=currentPage %>"/>
										<jsp:param name="pageCounter" value="<%=pageCounter %>"/>
										</jsp:include>
									</TD>
								</TR>
						
		<FORM id=aspnetForm name=aspnetForm action="<%=request.getContextPath()%>/user/apply.do" method=post  onsubmit="return validateForm();">
				<TR>
					<TD style="TEXT-ALIGN: center" colSpan=5>
					<DIV id=ctl00_ContentPlaceHolder1_Panel1>
					<TABLE class=style5 cellSpacing=0 cellPadding=0>
						<TBODY>
						
						<%
								DailyTiming dt = (DailyTiming)request.getAttribute("dailyTiming");
									if(dt != null) {
							
						 %>
								<TR>
								<TD style="TEXT-ALIGN: left"><SPAN
									id="yyyyyyyy" style="FONT-SIZE: small">考勤日期：</SPAN>
								<INPUT id="currentDate"
									style="FONT-SIZE: small; WIDTH: 86px; COLOR: #0000cc; HEIGHT: 16px"
									value="<%=new SimpleDateFormat("yyyy-MM-dd").format(dt.getWorkDate())%>"
									name="workdate" disabled="disabled"></TD>
								<TD style="TEXT-ALIGN: right"><SPAN
									id=ctl00_ContentPlaceHolder1_Label14 style="FONT-SIZE: small">工作时间：</SPAN>
								<INPUT id=ctl00_ContentPlaceHolder1_TextBox8
									style="FONT-SIZE: small; WIDTH: 30px; COLOR: #0000cc; HEIGHT: 16px"
									value=<%=dt.getWorkTime() %> name="workTime" /> <SPAN
									id=ctl00_ContentPlaceHolder1_Label15 style="FONT-SIZE: small">小时</SPAN>
								</TD>
								<TD style="TEXT-ALIGN: right"><SPAN
									id=ctl00_ContentPlaceHolder1_Label16 style="FONT-SIZE: small">加班时间：</SPAN>
								<INPUT id=ctl00_ContentPlaceHolder1_TextBox9
									style="FONT-SIZE: small; WIDTH: 30px; COLOR: #0000cc; HEIGHT: 16px"
									value=<%=dt.getOverTime() %> name="overTime" /> <SPAN
									id=ctl00_ContentPlaceHolder1_Label17 style="FONT-SIZE: small">小时</SPAN>
								</TD>
								<TD style="TEXT-ALIGN: right"><SPAN
									id=ctl00_ContentPlaceHolder1_Label18 style="FONT-SIZE: small">休假时间：</SPAN>
								<INPUT id=ctl00_ContentPlaceHolder1_TextBox10
									style="FONT-SIZE: small; WIDTH: 30px; COLOR: #0000cc; HEIGHT: 16px"
									value=<%=dt.getVocationTime() %> name="vocationTime" /> <SPAN
									id=ctl00_ContentPlaceHolder1_Label19 style="FONT-SIZE: small">小时</SPAN>
								</TD>
								<TD style="TEXT-ALIGN: right"><SPAN
									id=ctl00_ContentPlaceHolder1_Label20 style="FONT-SIZE: small">请假时间：</SPAN>
								<INPUT id=ctl00_ContentPlaceHolder1_TextBox11
									style="FONT-SIZE: small; WIDTH: 30px; COLOR: #0000cc; HEIGHT: 16px"
									value=<%=dt.getLeaveTime() %> name="leaveTime" /> <SPAN
									id=ctl00_ContentPlaceHolder1_Label21 style="FONT-SIZE: small">小时</SPAN>
									
									<input type="hidden" name="workDate" value="<%=new SimpleDateFormat("yyyy-MM-dd").format(dt.getWorkDate())%>" />
									<input type="hidden" name="edit" value="edit"/>
									<input type="hidden" name="dailyTimingID" value="<%=dt.getDailyTimingID() %>" />
								</TD>
							</TR>
							<TR>
								<TD colSpan=5><TEXTAREA
									id=ctl00_ContentPlaceHolder1_TextBox12
									style="WIDTH: 99.5%; COLOR: #0000cc; HEIGHT: 80px"
									name="workSummary"><%=dt.getReviewNote() %></TEXTAREA></TD>
							</TR>
								
						<%		
								}
						 %>
						 <%-- 
						
							<TR>
								<TD colSpan=5>
								
									<INPUT id=ctl00_ContentPlaceHolder1_Button2 type="submit" value="提 交" name="submit" onclick="return changeStatus('Pending')" />
									&nbsp; 
									<INPUT id=ctl00_ContentPlaceHolder1_Button1 type="submit" value="暂 存" name="save" onclick="return changeStatus('Saved')" /> 
									&nbsp; 
									<input type="hidden" name="status" value="" /> 
									
								</TD>
							</TR>
						--%>		
						</Form>
							
						
								</table>

							</table>


						</td>
					</tr>
				</table>
			</div>
		<jsp:include page="../footer.jsp"></jsp:include>
	</body>
</html>
